home *** CD-ROM | disk | FTP | other *** search
/ NetNews Offline 2 / NetNews Offline Volume 2.iso / news / comp / lang / c++-part2 / 13655 < prev    next >
Encoding:
Internet Message Format  |  1996-08-05  |  1.2 KB

  1. Path: druid.borland.com!usenet
  2. From: pete@borland.com (Pete Becker)
  3. Newsgroups: comp.lang.c++
  4. Subject: Re: Borlands Container Classes
  5. Date: 26 Mar 1996 16:30:43 GMT
  6. Organization: Borland International
  7. Message-ID: <4j963j$74n@druid.borland.com>
  8. References: <4j6q5c$jl3@mongol.sasknet.sk.ca>
  9. NNTP-Posting-Host: pbecker.borland.com
  10. Mime-Version: 1.0
  11. Content-Type: Text/Plain; charset=ISO-8859-1
  12. X-Newsreader: WinVN 0.99.5
  13.  
  14. In article <4j6q5c$jl3@mongol.sasknet.sk.ca>, psc1@mailhost.sasknet.sk.ca 
  15. says...
  16. >
  17. >This is probably an easy question but... I want to put one of my own 
  18. >classes in a TIArrayAsVector.  Everything goes well until link time when 
  19. >it gives me the error "Illegal structure operation in function 
  20. >TMICVectorImp<MyClass,TStandardAllocator>::Find(const MyClass *) cont".  
  21. >The code it dies on is:
  22. >
  23. >             if( Data[loc] &&
  24. >               *STATIC_CAST(T *,STATIC_CAST(void *,Data[loc])) == *t )
  25. >                  return loc;
  26. >
  27. >I'm not sure whats going on, I am passing a pointer as this is an 
  28. >indirect vector array.
  29. >
  30. >Anybody please, the documentation for the type cast *STATIC_CAST is 
  31. >strange.
  32.  
  33. The "structure operation" that the compiler is referring to is the == operation 
  34. on type T. MyClass must have an operator ==.
  35.  
  36.